/*
 *
 *      Copyright (c) 2018-2025, madp All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: 成都文思海辉金信软件有限公司
 *
 */

package com.pactera.madp.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pactera.madp.admin.api.entity.SysDept;
import com.pactera.madp.admin.api.vo.DeptLineDeptVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>
 * 部门管理 Mapper 接口
 * </p>
 *
 * @author madp
 * @since 2018-01-20
 */
public interface SysDeptMapper extends BaseMapper<SysDept> {

    void updateLines(@Param("rootLineDeptId") Integer rootLineDeptId, @Param("name") String name, @Param("localDeptName") String localDeptName);

    List<DeptLineDeptVO> getChildrens(@Param("lineDeptId") Integer lineDeptId);

    List<DeptLineDeptVO> getSelectDepts(@Param("lineDeptIds") List<Integer> lineDeptIds);

    List<Integer> getWxDeptIdsOrg(@Param("deptId") Integer deptId);

    List<Integer> getWxDeptIdsOrgByDeptIds(@Param("deptIds") List<Integer> deptIds);

    List<Integer> getWxDeptIdsLine(@Param("deptIds") List<Integer> deptIds);

    List<Map<String, Integer>> getChildrensOrg(@Param("deptId") Integer deptId);

    IPage getChildrenPage(Page page, @Param("deptId") Integer deptId);

    IPage getLineChildrenPage(Page page, @Param("deptId") Integer deptId);

    IPage getChildrenPageByObjectId(Page page, @Param("deptId") Integer deptId, @Param("objectId") Integer objectId);

    List<Integer> selectTreeLikeNew(@Param("name") String name);

    List<SysDept> depts(@Param("idSet") Set<Integer> idSet);

    List<String> getAllChildrenOrgCode(@Param("deptId") Integer deptId);

}
